package com.zdd.ehe.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zdd.ehe.entity.Permission;
import com.zdd.ehe.entity.Role;
import com.zdd.ehe.mapper.PermissionMapper;
import com.zdd.ehe.service.IPermissionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ZhuiZhu
 * @since 2023-03-13
 */
@Service
public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permission> implements IPermissionService {

    @Resource
    private PermissionMapper permissionMapper;

    /**
     * 分页查询权限列表
     *
     * @param page
     * @return
     */
    @Override
    public Page<Permission> getAllPermissionByPage(Page<Permission> page) {
        Page<Permission> pagex = permissionMapper.getAllPermissionByPage(page);
        return pagex;
    }


    /**
     * 添加权限
     * @param permission
     * @return
     */
    @Override
    public int addPermission(Permission permission){
        return permissionMapper.addPermission(permission);
    }
}
